package task1;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 东莞呵呵
 * Date:2022-05-12
 * Time:12:56
 */
public class Circle extends Shape{
    public double radius;

    public Circle() {
    }

    public Circle(String color, double radius) {
        super(color);
        this.radius = radius;
    }

    @Override
    public double getArea() {
        return 3.14*this.radius*this.radius;

    }

    @Override
    public double getPer() {
        return 3.14*2*radius;
    }

    @Override
    public String toString() {
        return "Circle{" +
                "radius=" + radius +
                ", area=" + this.getArea() +
                ", per=" + this.getPer() + '\'' +
                '}';
    }

    @Override
    public void shoeAll() {
        System.out.println(this.toString());
    }
}
